package Singleton;

public class test {
    void doSomething() {
        for (int i = 0; i < 10; i++) {
            Thread t = new Thread(new Runnable() {
                public void run() {
                    System.out.println("lazyMan's hashCode:"+lazyMan.getInstance().hashCode());
                }
            });
            t.start();
        }
    }
    void doSomethingDCL() {
        for (int i = 0; i < 10; i++) {
            Thread t = new Thread(new Runnable() {
                public void run() {
                    System.out.println("LazyManDCL's hashCode:"+LazyManDCL.getInstance().hashCode());
                }
            });
            t.start();
        }
    }
    public static void main(String[] args) {
        test test = new test();
        test.doSomethingDCL();
        System.out.println("============================");
        test.doSomething();
    }
}
